#include "SelectorImpl.h"
#include <assert.h>

ConditionalSelector* SelectorFactoryImpl::createConditionalSelector(
										SimpleSelector* selector,
										Condition* condition)
										throw(CSSException)
{
	assert(selector && condition);
	return new ConditionalSelectorImpl(*selector, *condition);
}

SimpleSelector* SelectorFactoryImpl::createAnyNodeSelector()throw(CSSException)
{
	throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return NULL;
}

SimpleSelector* SelectorFactoryImpl::createRootNodeSelector()throw(CSSException)
{
	throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return NULL;
}

NegativeSelector* SelectorFactoryImpl::createNegativeSelector(SimpleSelector* selector)
																throw(CSSException)
{
	throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return NULL;
}

ElementSelector* SelectorFactoryImpl::createElementSelector(const string* namespaceURI,
															const string& tagName)
															throw(CSSException)
{
	if(namespaceURI)
		throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return new ElementSelectorImpl(tagName);
}

CharacterDataSelector* SelectorFactoryImpl::createTextNodeSelector(const string& data)
															throw(CSSException)
{
	throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return NULL;
}

CharacterDataSelector* SelectorFactoryImpl::createCDataSectionSelector(const string& data)
															throw(CSSException)
{
	throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return NULL;
}

ProcessingInstructionSelector* SelectorFactoryImpl::createProcessingInstructionSelector(
															const string& target,
															const string& data)
															throw(CSSException)
{
	throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return NULL;
}

CharacterDataSelector* SelectorFactoryImpl::createCommentSelector(const string& data)
															throw(CSSException)
{
	throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return NULL;
}

ElementSelector* SelectorFactoryImpl::createPseudoElementSelector(
													const string* namespaceURI,
													const string& pseudoName)
													throw(CSSException)
{
	if(namespaceURI)
		throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return new PseudoElementSelectorImpl(pseudoName);
}

DescendantSelector* SelectorFactoryImpl::createDescendantSelector(Selector* parent,
											SimpleSelector* descendant)
											throw(CSSException)
{
	assert(parent && descendant);
	return new DescendantSelectorImpl(*parent, *descendant);
}

DescendantSelector* SelectorFactoryImpl::createChildSelector(Selector* parent,
											SimpleSelector* descendant)
											throw(CSSException)
{
	assert(parent && descendant);
	return new ChildSelectorImpl(*parent, *descendant);
}

SiblingSelector* SelectorFactoryImpl::createDirectAdjacentSelector(short nodeType,
													Selector* child,
													SimpleSelector*	directAdjacent)
													throw(CSSException)
{
	throw(CSSException(CSSException::SAC_NOT_SUPPORTED_ERR));
	return NULL;
}


